| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import { |
||
| 28 | export default function removeDuplicateAttr(text, json) { |
||
| 29 | var regAbe = /{{abe[\S\s].*?duplicate=['|"]([\S\s].*?['|"| ]}})/g |
||
| 30 | var matches = text.match(regAbe) |
||
| 31 | if(typeof matches !== 'undefined' && matches !== null){ |
||
| 32 | |||
| 33 | Array.prototype.forEach.call(matches, (match) => { |
||
| 34 | var keyAttr = getAttr(match, 'key') |
||
| 35 | |||
| 36 | if(typeof match !== 'undefined' && match !== null) { |
||
| 37 | var arrayKeyAttr = keyAttr.split('.') |
||
| 38 | recurseDeleteKey(json, arrayKeyAttr) |
||
| 39 | } |
||
| 40 | }) |
||
| 41 | } |
||
| 42 | |||
| 43 | return json |
||
| 44 | } |